home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 6: Level 6 / 17 Bit - Level 6 (1998)(Epic Marketing)[!].iso / quartz / q0429.dms / q0429.adf / libray / libtext / texture.h < prev    next >
C/C++ Source or Header  |  1991-08-08  |  2KB  |  80 lines

  1. /*
  2.  * texture.h
  3.  *
  4.  * Copyright (C) 1989, 1991, Craig E. Kolb
  5.  * All rights reserved.
  6.  *
  7.  * This software may be freely copied, modified, and redistributed
  8.  * provided that this copyright notice is preserved on all copies.
  9.  *
  10.  * You may not distribute this software, in whole or in part, as part of
  11.  * any commercial product without the express consent of the authors.
  12.  *
  13.  * There is no warranty or other guarantee of fitness of this software
  14.  * for any purpose.  It is provided solely "as is".
  15.  *
  16.  * $Id: texture.h,v 4.0 91/07/17 14:44:19 kolb Exp Locker: kolb $
  17.  *
  18.  * $Log:    texture.h,v $
  19.  * Revision 4.0  91/07/17  14:44:19  kolb
  20.  * Initial version.
  21.  * 
  22.  */
  23. #ifndef TEXTURE_H
  24. #define TEXTURE_H
  25.  
  26. #include "libobj/geom.h"
  27. #include "libsurf/surface.h"
  28. #include "mapping.h"
  29.  
  30. /*
  31.  * Surface properties
  32.  */
  33. #define COLOR        0    /* AMBIENT, DIFFUSE, SPECULAR and BODY */
  34. #define AMBIENT        1
  35. #define DIFFUSE        2
  36. #define SPECULAR    3
  37. #define BODY        4
  38. #define REFLECT        5
  39. #define TRANSP        6
  40. #define SPECPOW        7
  41. #define BUMP        8
  42. #define INDEX        9
  43.  
  44. #define TextPointToModel(p)    PointTransform(p, &model2text.itrans)
  45. #define TextPointToPrim(p)    PointTransform(p, &prim2text.itrans)
  46. #define TextPointToWorld(p)    PointTransform(p, &world2text.itrans)
  47. #define TextRayToModel(p)    RayTransform(r, &model2text.itrans)
  48. #define TextRayToPrim(r)    RayTransform(r, &prim2text.itrans)
  49. #define TextRayToWorld(r)    RayTransform(r, &world2text.itrans)
  50. #define TextNormToModel(n)    NormalTransform(n, &model2text.trans)
  51. #define TextNormToPrim(n)    NormalTransform(n, &prim2text.trans)
  52. #define TextNormToWorld(n)    NormalTransform(n, &world2text.trans)
  53.  
  54. #define ModelPointToText(p)    PointTransform(p, &model2text.trans)
  55. #define ModelNormToText(n)    NormalTransform(n, &model2text.itrans)
  56. #define ModelRayToText(r)    RayTransform(r, &model2text.trans)
  57.  
  58. typedef char *TextRef;
  59.  
  60. /*
  61.  * Texture structure
  62.  */
  63. typedef struct Texture {
  64.     TextRef data;            /* Texturing info */
  65.     void    (*method)();        /* method */
  66.     Trans    *trans;            /* transformation info */
  67.     short    animtrans;        /* is the transformation animated? */
  68.     struct Texture *next;        /* next in list */
  69. } Texture;
  70.  
  71. extern Texture    *TextCreate(), *TextAppend();
  72. extern void    DNoise3(), VfBm(), TextApply(), MakeBump(), Wrinkled();
  73. extern Float    Noise3(), Noise2(), Chaos(), Marble(), fBm();
  74. extern int    TileValue();
  75. Color        *ColormapRead();
  76.  
  77. extern Trans    model2text, prim2text, world2text;
  78.  
  79. #endif TEXTURE_H
  80.